Port rich text field registration off of XSLT#1862
Open
philipcaisip wants to merge 12 commits intohermionefrom
Open
Port rich text field registration off of XSLT#1862philipcaisip wants to merge 12 commits intohermionefrom
philipcaisip wants to merge 12 commits intohermionefrom
Conversation
Starting simple code to port RTF registration from XSLT into HTML custom components. Still need some way of testing actual TinyMCE import and use.
TinyMCE adds its own forward slash when stringing together urls for loading plugins ands themes etc. This made a double // in the url since resourceLoader takes urls with the / suffix already there. This extra / is currently being cut off in rtf.mjs. Although, it may be better off getting cut in resourceLoader.getUrlFromImportMap().
Switched from using the ui:rtf element in the raw XML to using wc-rtf custom HTML components. Still need a way to import the rtf module without the XSLT and to do further unit testing to get better coverage on rtf.mjs.
Instead of using a blank custom element to mark rtf fields, the actual input textarea element is extended as a custom element. This is to handle the rtf import problem, since now it is easy to detect when the rtf module should be imported through the existance of the textarea in textarea.mjs. Potential problem: this functionality only plays nice with rtf components that are not read-only. This is not a problem if components are unable to switch between being read-only and not, since read-only rtf fields don't seem to have a need to be registered through TinyMCE. If that is not the case, however, it will have to be accounted for in another way.
This is to avoid any errors that may be caused by fetching chars from null values.
Contributor
|
It should be noted that WebKit does not suppport extending elements |
Member
Oh darn it! You are right! Nowadays that means Safari. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is#browser_compatibility |
Due to webkit not supporting the extension of existing html elements custom ones, regular custom elements have to be used. It is back to using the empty wc-rtf marker element. Note that the definition of this element is still done in textArea.mjs, so rtf.mjs can continue being imported on-demnad.
This is as advised in another fix (eager components port) since we are trying to move away from XML entirely anyways.
Using a mock of TinyMCE, rtf is now tested for default configuration. Slight remodel of the rtf code to use resourceLoader to import TinyMCE was also done. This was to make it possible to mock TinyMCE by pointing the testing suite towards the mock with an import map in the DOM.
RTF tests were previously faililng when run after the initialise tests, since it changes that suite changes the dom and doesn't change it back. This has been fixed up and all tests are passing now.
|
Contributor
Author
|
Hi @ricksbrown, this is ready to review now. RTFs are marked with a custom HTML component that then get passed to TinyMCE, instead of the XSLT doing that. There's also some new unit tests that use a mock TinyMCE, which I've put in a new mock-modules folder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.